package com.cfpl.admin_service.mapper;

import com.cfpl.admin_service.VO.DueRecord;
import com.cfpl.project_common.pojo.PesticideAcquireRecord;
import com.cfpl.project_common.pojo.PesticideType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cfpl.project_common.pojo.PesticideUsageRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author 14720
* @description 针对表【pesticide_type(农药种类表)】的数据库操作Mapper
* @createDate 2023-10-10 11:09:53
* @Entity com.cfpl.project_common.pojo.PesticideType
*/
@Mapper
public interface PesticideTypeMapper extends BaseMapper<PesticideType> {

    /**
     * 添加农药领取记录
     * @param pesAcqRecord 领取记录
     */
    void addPesticideAcquireRecord(@Param("pesAcqRecord")PesticideAcquireRecord pesAcqRecord);

    /**
     * 添加农药使用记录
     * @param pesUsaRecord 使用记录
     */
    void addPesticideUsageRecord(@Param("pesUsaRecord")PesticideUsageRecord pesUsaRecord);

    /**
     * 扣减库存
     * @param pesticideId  农药id
     * @param getStock  扣减库存量
     */
    void deductPesticideStock(@Param("pesticideId")Long pesticideId,@Param("getStock")int getStock);

    /**
     * 查询农药即将到期的农药施用记录
     */
    List<DueRecord> queryDuePesticideRecord(@Param("interval") Integer interval);


}




